<template>
	<view>
		<view class="header">
			<view class="black_1">{{info.transaction_fees}}</view>
			<view class="black_2">交易手续费总额</view>
			<view class="black_3">加入日期： <uni-dateformat :date="info.apply_time*1000"
					format="yyyy-MM-dd hh:mm:ss"></uni-dateformat>
			</view>
		</view>
		<view class="black_4">
			<view class="line_1">
				<view class="left">我的分红</view>
				<view class="right" @click="mingix()">查看明细</view>
			</view>
			<view class="line_2">
				<view class="left">
					<view class="text1">{{info.today_bonus_amount}}</view>
					<view class="text2">今日获得分红</view>
				</view>
				<view class="left">
					<view class="text1">{{info.count_bonus_amount}}</view>
					<view class="text2">累计获得分红</view>
				</view>
			</view>
		</view>

		<view class="black_5">
			<view class="line_1">
				<view class="text1">站长昵称</view>
				<view class="text1">加入日期</view>
				<view class="text1">累计分红</view>
			</view>
			<template v-for="(item,index) in list">
				<view class="item">
					<view class="left">
						<image class="img" :src="item.user.avatar"></image>
						<view class="text1">{{item.user.nickname}}</view>
					</view>
					<view class="middle">
						<uni-dateformat :date="item.add_time*1000" format="yyyy-MM-dd">
						</uni-dateformat>
					</view>
					<view class="right">
						{{item.count_bonus_amount}}
					</view>

				</view>
			</template>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {
					"transaction_fees": "",
					"apply_time": 0,
					"today_bonus_amount": "",
					"count_bonus_amount": ""
				},
				list: [{
					"user_id": 6,
					"add_time": 1690358036,
					"count_bonus_amount": "51521.00",
					"user": {
						"id": 6,
						"n_id": "QWC6",
						"nickname": "中应交易所",
						"avatar": "http://qwc.test/uploads/avatar_default.png"
					}
				}],
				page: 1,
			};
		},
		onLoad() {
			this.api.http.requests('site/info', {}, res => {
				this.info = res.data
			}, "POST")
			this.list.length = 0
			this.page = 1
			this.getList()
		},
		methods: {
			mingix() {
				uni.navigateTo({
					url: '/pages/trading/MasterDetails'
				})
			},
			getList() {
				var data = {
					page: this.page
				}
				var that = this
				this.api.http.requests('site/lists', data, res => {
					if (res.data && res.data.length > 0) {
						that.list = that.list.concat(res.data)
					}
				}, "POST")
			}
		},
		onReachBottom() {
			this.page = this.page + 1
			this.getList()
		}
	}
</script>
<style>
	page {
		background-color: #F5F5F5;
	}
</style>
<style scoped lang="less">
	.header {
		padding: 10px;
		text-align: center;
		background: #FE903D;

		.black_1 {
			margin-top: 30px;
			font-size: 63rpx;
			font-weight: 400;
			color: #FFFFFF;
		}

		.black_2 {
			margin-top: 10px;
			font-size: 30rpx;
			font-weight: 400;
			color: #FFE6D5;
		}

		.black_3 {
			margin-top: 10px;
			font-size: 25rpx;
			font-weight: 400;
			color: #FFFFFF;
		}

	}

	.black_4 {
		background-color: white;
		border-radius: 5px;
		padding: 10px;
		margin: 10px;

		.line_1 {
			font-size: 28rpx;
			font-weight: 800;
			color: #3A3A3A;
			display: flex;
			justify-content: space-between;

			.right {
				font-size: 25rpx;
				font-weight: 400;
				color: #FE903D;
			}
		}

		.line_2 {
			margin: 10px 0px;
			font-size: 42rpx;
			font-weight: 400;
			color: #333333;
			display: flex;
			justify-content: space-between;
			text-align: center;
			align-content: center;

			.left {
				width: 50%;

				.text2 {
					font-size: 21rpx;
					font-weight: 400;
					color: #666666
				}
			}

		}
	}

	.black_5 {
		margin: 10px 10px;
		background-color: white;
		border-radius: 5px;
		padding: 10px;

		.line_1 {
			display: flex;
			justify-content: space-between;
			padding: 5px 0px;
			font-size: 28rpx;
			font-weight: 800;
			color: #333333;
			text-align: center;
			align-content: center;

			.text1 {
				width: 33%;
			}

		}

		.item {
			padding: 15px 0px;
			display: flex;
			justify-content: space-between;
			text-align: center;

			border-bottom: 1px solid #ECECEC;

			.left {
				width: 33%;
				display: flex;
				align-items: center;

				.img {

					width: 20px;
					height: 20px;
					border-radius: 50%;
				}

				.text1 {
					margin-left: 10px;

				}
			}

			.middle {
				width: 33%;
				font-size: 25rpx;
				font-weight: 400;
				color: #666666;
			}

			.right {
				width: 33%;
				font-size: 28rpx;
				font-weight: bold;
				color: #FE903D;
			}
		}
	}
</style>